/*
 * Created By Visual Studio 2005
 * Create by: daqingshu
 * Create at: 2007-1-13 21:21:12
 * Organization: BIT
 * 
 *
 */

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Telerik.WebControls;
using Adge.UI;


namespace Adge.Web.UI.Admin
{
    public partial class leftmenu : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //BindNavBar();
            }
        }

        private void BindNavBar()
        {
            DataSet ds = new DataSet();
            ds.ReadXml(Server.MapPath("~/App_Data/Navs.xml"));
            NavBar.DataSource = ds;
            NavBar.DataTextField = "Text";
            NavBar.ItemDataBound += new RadPanelbarEventHandler(NavBar_ItemDataBound);
            NavBar.DataNavigateUrlField = "NavigateUrl";
            this.NavBar.DataBind();
        }

        void NavBar_ItemDataBound(object sender, RadPanelbarEventArgs e)
        {
            DataRowView row = (DataRowView)e.Item.DataItem;
            e.Item.ImageUrl = row["ImageUrl"].ToString();
            e.Item.Target = row["Target"].ToString();            
        }
    }
}
